import React, { useState, useEffect } from "react";
import { Animated } from "react-native";


export default function AniScaleIn(props) {
    const { transformAttr } = props;
    const [anim,setAnim] = useState(new Animated.Value(1000));

    useEffect(() => {
        Animated.timing(
            anim,
            {
                toValue: 0,
                duration: 200,
                useNativeDriver:true
            }
        ).start();
    }, [anim]);

    // const { offsetX,offsetY,scaleX,scaleY } = transformAttr;

    return (<Animated.View 
      style={{
          position:"absolute",
          width: "100%",
          height: "100%",
          bottom: 0,
        //   transform: [{ translateX:offsetX },{ translateY:offsetY },{ scaleX:scaleX },{ scaleY:scaleY }],
          ...props.style,
        }}
    >
        {props.children}
    </Animated.View>);
}
